<%-- 
    Document   : details
    Created on : Apr 2, 2012, 3:33:23 AM
    Author     : Apol
--%>

<%-- Header Area --%>
<%@ include file="/template/header.jsp" %> 
<%-- End of Header Area --%>

<%! ArrayList<CartItem> cartItems; %>
<% cartItems = transaction.getItems(); %>

<%-- Content Area --%>
<h2>Order #<%= transaction.getTrans_id() %></h2>

<div class="submenu">
    <ul>
        <li><a href="/account/history">Go Back</a></li>
    </ul>
    <div class="clear"></div>
</div>

<h3>Process Logs</h3>
<table class="generic-vertical-table">
    <tr>
        <th>Date</th>
        <th>Status</th>
    </tr>
    <% for (OrderLog o : order_log) { %>
    <tr>
        <td><%= o.getDate() %></td>
        <td><%= o.getStatus() %></td>
    </tr>
    <% } %>
</table>

<h3>Delivery Info</h3>
<p style="text-align: center;"><%= address != null ? address.getAddress() : "Not Applicable" %></p>
<p style="text-align: center;"><%= address != null ? address.getLandmark() : "Not Applicable" %></p>

<h3>Items</h3>
<table class="generic-vertical-table">
    <tr>
        <th>Product</th>
        <th>Quantity</th>
        <th>Unit Price</th>
        <th>Total Price</th>
    </tr>
    <%! double total = 0; %>
    <% total = 0; %>
    <% for (CartItem c : cartItems) { %>
    <tr>
        <td><%= c.getName() %></td>
        <td><%= c.getQty() %></td>
        <td><%= c.getPrice() %></td>
        <td><%= c.total() %></td>
    </tr>
    <% total += c.total(); } %>
    <tr align="right">
        <th colspan="2">Subtotal</th>
        <th colspan="2">Php <%= total %></td>
    </tr>
    <tr align="right">
        <th colspan="2">Delivery Charge (5%)</th>
        <th colspan="2">Php <%= total*0.05 %></td>
    </tr>
    <tr align="right">
        <th colspan="2">Total</th>
        <th colspan="2">Php <%= total+(total*0.05) %></td>
    </tr>
</table>
<%@ include file="/template/footer.jsp" %> 

